<?php

namespace app\common\service;

use app\common\model\Label;
use app\http\exception\ApiException;

class LabelService extends BaseService
{
        public static function getLabelPage( $data ){
            return Label::build()->orderBy('label_id' ,'desc')->_paginate();
        }

        public static function getLabelList( $data ){
            return Label::build()->orderBy('label_id' , 'desc')->select();
        }

        public static function getLabelItem( $id ){
            return Label::build()->findOrFail($id);
        }

        public static function delLabelItem( Label $Label ){
            return $Label->delete();
        }

    	public static function setLabelItem(Label $Label, $data){
            $Label->save($data);
            return $Label;
        }


        public static function addLabelItem($data)
        {
            $model = new Label();
            return $model->save($data);
        }


}
